<!-- 发票信息 -->
<template>
	<view class="content">
<!-- #ifdef APP-PLUS -->
		<Header :isShowRight="false" title="发票信息" @back='back' arrowColor='#000' textColor='#000' bgColor="#fff">
		</Header>
		
		<view style="height: 120rpx;"></view>
		<!-- #endif -->
		<view class="contents">
			<view class="infoBox">
				<text>申请信息</text>
				<view class="color1" v-if='list.invoiceStatus==1'>开票中</view>
				<view class="color2" v-if='list.invoiceStatus==2'>已开票</view>
			</view>
			<!-- 电子发票 -->
			<view class="eleBox" v-if='list.invoiceType==1'>
				<view class="firstBox">
					<view class="flexed">
						<text>发票抬头</text>
						<text v-if='list.invoiceRise==1'>个人/事业单位</text>
						<text v-else>企业</text>
					</view>
					<view class="flexed">
						<text>抬头名称</text>
						<text>{{list.invoiceRiseName}}</text>
					</view>
					<view class="flexed">
						<text>手机号</text>
						<text>{{list.phone}}</text>
					</view>
				</view>
				<view class="secondBox">
					<view class="flexed">
						<text>发票类型</text>
						<!-- <text>{{list.looked}}</text> -->
						<text v-if='list.invoiceType==1'>电子发票</text>
						<text v-if='list.invoiceType==2'>纸质发票</text>
					</view>
					<view class="flexed">
						<text>邮箱</text>
						<text>{{list.email}}</text>
					</view>
				</view>
				<view class="thirdBox">
					<!-- <view class="flexed">
						<text>申请开票时间</text>
						<text>{{list.createTime}}</text>
					</view> -->
					<view class="flexed">
						<text>含{{list.orderNumber}}个订单</text>
						<view style="display:flex;align-items: center;" @click="Toview">
							<text style="color:#626262">查看</text>
							<u-icon name="arrow-right" size="30"></u-icon>
						</view>
					</view>
					<view class="flexed">
						<text>{{list.createTime}}</text>
						<view class="invoiceMoney" style="display: flex;align-items: baseline;color: #FFA025;">
							<text style="font-size: 22rpx;">￥</text>
							<view style="font-size: 36rpx;">{{list.invoiceMoney}}</view>
						</view>
					</view>
				</view>

				<view class="fourthBox" v-if='list.invoiceStatus>1'>
					<view class="text">开票信息</view>
					<view class="_box">
						<view class="flexed">
							<text>发出时间</text>
							<text>{{list.auditTime}}</text>
						</view>
					</view>
				</view>
			</view>
			<!-- 纸质发票 -->
			<view class="paperBox" v-if='list.invoiceType==2'>
				<view class="firstBox">
					<view class="flexed">
						<text>发票抬头</text>
						<text v-if='list.invoiceRise==1'>个人/事业单位</text>
						<text v-else>企业</text>
					</view>
					<view class="flexed">
						<text>抬头名称</text>
						<text>{{list.invoiceRiseName}}</text>
					</view>
					<view class="flexed" v-if='list.invoiceRise==2'>
						<text>识别号</text>
						<text>{{list.identificationNo}}</text>
					</view>
					<view class="flexed">
						<text>企业电话</text>
						<text>{{list.phone}}</text>
					</view>
					<view class="flexed" v-if='list.invoiceRise==2'>
						<text>开户银行</text>
						<text>{{list.bank}}</text>
					</view>
					<view class="flexed" v-if='list.invoiceRise==2'>
						<text>银行账号</text>
						<text>{{list.bankCard}}</text>
					</view>
					<view class="flexed" v-if='list.invoiceRise==2'>
						<text>企业地址</text>
						<text>{{list.businessAddress}}</text>
					</view>
				</view>
				<view class="secondBox">
					<view class="flexed">
						<text>发票类型</text>
						<!-- <text>{{list.looked}}</text> -->
						<text v-if='list.invoiceType==1'>电子发票</text>
						<text v-if='list.invoiceType==2'>纸质发票</text>
					</view>
					<view class="flexed">
						<text>姓名</text>
						<text>{{list.receivingName}}</text>
					</view>
					<view class="flexed">
						<text>电话</text>
						<text>{{list.receivingPhone}}</text>
					</view>
					<view class="flexed">
						<text>地址</text>
						<text>{{list.receivingAddress}}</text>
					</view>
				</view>
				<view class="thirdBox">
					<view class="flexed">
						<text>含{{list.orderNumber}}个订单</text>
						<view style="display:flex;align-items: center;" @click="Toview">
							<text style="color:#626262">查看</text>
							<u-icon name="arrow-right" size="30"></u-icon>
						</view>
					</view>
					<view class="flexed">
						<text>{{list.createTime}}</text>
						<view class="invoiceMoney" style="display: flex;align-items: baseline;color: #FFA025;">
							<text style="font-size: 22rpx;">￥</text>
							<view style="font-size: 36rpx;">{{list.invoiceMoney}}</view>
						</view>
					</view>
				</view>
				<view class="fourthBox">
					<view class="text">开票信息</view>
					<view class="_box">
						<view class="" v-if='list.invoiceStatus==2'>
							<view class="flexed">
								<text>快递公司</text>
								<text>{{list.expressName}}</text>
							</view>
							<view class="flexed">
								<text>快递单号</text>
								<text>{{list.expressNo}}</text>
							</view>
						</view>
						<view class="flexed">
							<text>发出时间</text>
							<text>{{list.auditTime}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		invoiceDetail
	} from '@/apis/apis.js'
	import Header from '@/components/c_header.vue'
	export default {
		components: {
			Header
		},
		data() {
			return {
				list: {
					// info: 2, //1是开票中，2是已开票
					// type: 2, //1是电子发票，2是纸质发票
					// looked: '个人/事业单位',
					// name: '张三',
					// moblie: '12121221545',
					// email: '12221@qq.com',
					// applyTime: '2022-08-04 12:00',
					// sendTime: '2022-08-05 12:00'

				},
				//上一个页面传过来的id
				id: '',
				orderIds: ''
			}
		},
		created() {
			this.getInvoiceDetail()
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			//开票详情数据
			getInvoiceDetail() {
				invoiceDetail({
					id: this.id
				}).then(res => {
					console.log(res);
					res.data.invoiceMoney = res.data.invoiceMoney.toFixed(2)
					this.list = res.data
					this.orderIds = res.data.orderIds
				})
			},
			//查看
			Toview() {
				uni.navigateTo({
					url: './containOrder?id=' + this.orderIds
				})
			}
		},
		onLoad(options) {
			console.log(options);
			this.id = options.id
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		// height: 100vh;
		background: #F8F8F8;
		min-height: 100vh;

		.bg {
			width: 100%;
			height: 140rpx;
			padding: 76rpx 0 0 32rpx;
			background: #fff;
		}

		.contents {
			width: 92%;
			margin: 0 auto;

			// border: 1rpx solid red;
			.infoBox {
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #020202;
				padding: 42rpx 36rpx 32rpx 30rpx;

				.color1 {
					font-size: 30rpx;
					color: #F04848;
				}

				.color2 {
					font-size: 30rpx;
					color: #3BB66C;
				}
			}

			.eleBox,
			.paperBox {

				.firstBox,
				.secondBox,
				.thirdBox {
					background: #FFFFFF;
					box-shadow: 0px 3px 13px 0px rgba(127, 129, 133, 0.1000);
					border-radius: 20rpx;

					.flexed {
						height: 110rpx;
						margin: 0 14rpx;
						padding: 0 16rpx;
						border-bottom: 2rpx solid #F2F2F2;
						display: flex;
						justify-content: space-between;
						align-items: center;
						font-size: 15px;
						font-family: Source Han Sans CN;
						font-weight: 500;
						color: #020202;

						&>text:nth-child(2) {
							font-weight: 400;
							color: #626262;
						}
					}
				}

				.secondBox {
					margin: 30rpx 0;
				}

				.fourthBox {
					padding-bottom: 100rpx;

					.text {
						padding: 38rpx 0 32rpx 30rpx;
						// padding: 42rpx 36rpx 32rpx 30rpx;
						font-size: 32rpx;
						font-family: Source Han Sans CN;
						font-weight: 500;
						color: #020202;
					}

					._box {
						background: #FFFFFF;
						box-shadow: 0px 3px 13px 0px rgba(127, 129, 133, 0.1000);
						border-radius: 20rpx;

						.flexed {
							background: #fff;
							height: 110rpx;
							margin: 0 14rpx;
							padding: 0 16rpx;
							border-bottom: 2rpx solid #F2F2F2;
							display: flex;
							justify-content: space-between;
							align-items: center;
							font-size: 15px;
							font-family: Source Han Sans CN;
							font-weight: 500;
							color: #020202;

							&>text:nth-child(2) {
								font-weight: 400;
								color: #626262;
							}
						}
					}

				}
			}

			.paperBox {}
		}
	}
</style>
